/**
 * api 对应后台的接口文件
 */
import serveItemApi from './mod/serveItemApi';
import newApis from './mod/newApis';
import aboutApi from './mod/aboutApi';
import nationsApi from './mod/nationsApi';
import contactUsApi from './mod/contactUsApi';
import fileApi from './mod/fileApi';
import columnApi from './mod/columnApi';
let urlObj = {
    serveItemApi,
    newApis,
    aboutApi,
    nationsApi,
    contactUsApi,
    fileApi,
    columnApi,
};
// 是否添加模块前缀
let api = {};
let isOPenPrefix = process.env.VUE_APP_OPEN_PREFIX;
for (const key in urlObj) {
    if (Object.hasOwnProperty.call(urlObj, key)) {
        const element = urlObj[key];
        let prefix = element.prefix;
        let url = element.url;
        api[key] = {};
        for (const k in url) {
            api[key][k] = isOPenPrefix === 'true' ? '/' + prefix + url[k] : url[k];
        }
    }
}

export default api;
